import page from "@/pages.json";
// import page from "@/pages.js";
// const parsedData = json5.parse(data);
// const json5 = require('json5');
export const getPagesJson = function () {
  // 获取主包和分包
  // const { pages, subPackages } = page();
  const { pages, subPackages } = page;
  //把主包的页面转换成路由
  const list = pages;
  //把分包的页面转换成路由
  subPackages.forEach((item) => {
    let root = item.root;
    item.pages.forEach((t) => {
      t.path = `/${root}/${t.path}`;
      list.push(t);
    });
  });
  uni.setStorageSync("__APP__pages", list);
};
